home *** CD-ROM | disk | FTP | other *** search
/ Know Your Baseball - The Greatest Player Resource / Know Your Baseball - Greatest Player.iso / Baseball / Director / SHARED.CST / 00009_Script_MenuObject < prev    next >
Text File  |  1998-09-21  |  11KB  |  443 lines

  1. property ScrnHelp,MenuFunctions,Sound1,Sound2,Sound3,¼
  2. VideoCues,ThisHand,VideoDetails
  3.  
  4. on Birth Me
  5.   set ScrnHelp = []
  6.   set MenuFunctions = []
  7.   set Sound1 = []
  8.   set Sound2 = []  
  9.   set Sound3 = []
  10.   set VideoCues = []
  11.   set ButtStatus = []
  12.   set ThisHand = []
  13.   set VideoDetails = []
  14.   return me
  15. end
  16.  
  17.  
  18. on SetMenuFunctions me
  19.   set x = the number of lines in (field "MenuItems")
  20.   repeat with Y = 1 to X
  21.     append (MenuFunctions, word 2 of Line Y of field "MenuItems")
  22.   end repeat
  23.   return Menufunctions
  24. end
  25.  
  26. -- Load special functions for KTG
  27.  
  28. on mLoadKTGD me,Scrn
  29.   repeat with Y = 10  to 22  setAt list, position, value
  30.     setat (MenuFunctions,y,"ShowinfoD")
  31.   end repeat
  32.   return Menufunctions
  33. end
  34.  
  35. on mLoadKTGO me,Scrn
  36.   repeat with Y = 10  to 22  setAt list, position, value
  37.     setat (MenuFunctions,y,"ShowinfoO")
  38.   end repeat
  39.   return Menufunctions
  40. end
  41.  
  42. on mLoadKTGC me,Scrn
  43.   repeat with Y = 10  to 22  setAt list, position, value
  44.     setat (MenuFunctions,y,"ShowinfoC")
  45.   end repeat
  46.   return Menufunctions
  47. end
  48.  
  49. -- load the screen prompts from cast member ScreenPrompts in each movie--
  50.  
  51. on NewIndicators me
  52.   set ScrnHelp = []
  53.   set p = Empty
  54.   repeat with x = 1 to 48
  55.     set pos =  line x of field "ScreenPrompts"
  56.     set w = the number of words in pos
  57.     repeat with c = 2 to w
  58.       put  word c of pos & " " into word C-1 of p
  59.     end repeat
  60.     append (ScrnHelp, p)
  61.     set p = Empty
  62.   end repeat
  63.   return Prompts
  64. end
  65. --- variations of indicators for KTG movies where offense defence change
  66.  
  67. on  mOffndicators me
  68.   set ScrnHelp = []
  69.   set p = Empty
  70.   repeat with x = 1 to 48
  71.     set pos =  line x of field "ScreenPrompts3"
  72.     set w = the number of words in pos
  73.     repeat with c = 2 to w
  74.       put  word c of pos & " " into word C-1 of p
  75.     end repeat
  76.     append (ScrnHelp, p)
  77.     set p = Empty
  78.   end repeat
  79.   return Prompts  
  80. end
  81.  
  82. on  mCenIndicators me
  83.   set ScrnHelp = []
  84.   set p = Empty
  85.   repeat with x = 1 to 48
  86.     set pos =  line x of field "ScreenPrompts2"
  87.     set w = the number of words in pos
  88.     repeat with c = 2 to w
  89.       put  word c of pos & " " into word C-1 of p
  90.     end repeat
  91.     append (ScrnHelp, p)
  92.     set p = Empty
  93.   end repeat
  94.   return Prompts  
  95. end
  96.  
  97. --- called from SSQ movies only to set the cards needed
  98. -- load the card names from cast member cards in each SSQ movie--
  99.  
  100. on DealTheCards me 
  101.   set ThisHand = []
  102.   set p = Empty
  103.   repeat with x = 1 to 48
  104.     set pos =  line x of field "Cards"
  105.     set w = the number of words in pos
  106.     repeat with c = 2 to w
  107.       put  word c of pos & " " into word C-1 of p
  108.     end repeat
  109.     setat( ThisHand,X, p)
  110.     set p = Empty
  111.   end repeat
  112. end
  113.  
  114.  
  115. --  SetTheCues sets the cues for the video clips in SSQ movies
  116. -- called from an SSQ start movie
  117.  
  118. on mSetTheCues me
  119.   -- load the  cue points from cast member clips in each movie--
  120.   
  121.   repeat with x = 1 to 48
  122.     set p = Empty
  123.     set pos =  line x of field "clips"
  124.     set w = the number of words in pos
  125.     repeat with c = 2 to w
  126.       put  word c of pos & " " into word C-1 of p 
  127.     end repeat
  128.     setAt(VideoCues,x, p)
  129.     set p = Empty
  130.   end repeat
  131. end
  132.  
  133. -- load the sound file namess from cast members Sounds1 Sounds2  Sounds3 in each movie--
  134.  
  135. on mloadSoundNames me
  136.   
  137.   -- for first card
  138.   
  139.   set p = Empty
  140.   repeat with x = 1 to 48
  141.     set snd=  line x of field "Sounds1"
  142.     set w = the number of words in snd
  143.     repeat with c = 2 to w
  144.       put  word c of snd & " " into word C-1 of p 
  145.     end repeat
  146.     append(Sound1, p)
  147.     set p = Empty
  148.   end repeat
  149.   
  150.   --for second card
  151.   
  152.   repeat with z = 1 to 48
  153.     set snd=  line z of field "Sounds2"
  154.     set w = the number of words in snd
  155.     repeat with c = 2 to w
  156.       put  word c of snd & " " into word C-1 of p 
  157.     end repeat
  158.     append(Sound2, p)
  159.     set p = Empty
  160.   end repeat
  161.   
  162.   --for third  card
  163.   
  164.   repeat with Q = 1 to 48
  165.     set snd=  line Q of field "Sounds3"
  166.     set w = the number of words in snd
  167.     repeat with c = 2 to w
  168.       put  word c of snd & " " into word C-1 of p 
  169.     end repeat
  170.     append(Sound3, p)
  171.     set p = Empty
  172.   end repeat
  173.   
  174. end
  175.  
  176. -- KTG opening menu -- the other know the game screen use the SSQ script to load 3 sets
  177. -- load the sound file names from cast members Sounds
  178.  
  179. on mloadSoundNamesKTG me
  180.   set p = Empty
  181.   repeat with x = 1 to 48
  182.     set snd=  line x of field "Sounds1"
  183.     set w = the number of words in snd
  184.     repeat with c = 2 to w
  185.       put  word c of snd & " " into word C-1 of p 
  186.     end repeat
  187.     append(Sound1, p)
  188.     set p = Empty
  189.   end repeat
  190.   
  191.   
  192.   
  193.   -- -------              get a specifc list or item a list  or set an item in a list from MenuObject      ------------
  194.   
  195. on De me -- temp script for testing loading of lists remove before release
  196.   beep
  197.   
  198.   --    put  ScrnHelp 
  199.   -- put MenuFunctions 
  200.   -- put sound1
  201.   put VideoCues
  202.   --  put ButtStatus
  203.   -- put ThisHand
  204.   --  put CardStatusFlags
  205.   put sound1
  206.   -- put VideoCues 
  207.   put VideoDetails
  208. end
  209.  
  210. --  changes card list to bit mapped text list for marker 1Video in SSQ movies
  211.  
  212. on MsetSecondaryCards me, Player,List
  213.   set ThisHand = []
  214.   -- set txt prompts for players
  215.   set p = Empty
  216.   repeat with x = 1 to 48
  217.     set  txt =  line x of field "BitMapTXT"
  218.     set w = the number of words in txt
  219.     repeat with c = 2 to w
  220.       put  word c of txt & " " into word C-1 of p 
  221.     end repeat
  222.     append(ThisHand, p)
  223.     set p = Empty
  224.   end repeat
  225.   
  226.   -- set txt prompts for video marker where card 2 has been selected
  227.   
  228.   if List = 2 then
  229.     set  txt =  line player of field "BitMap2"
  230.     set w = the number of words in txt
  231.     repeat with c = 2 to w
  232.       put  word c of txt & " " into word C-1 of p 
  233.     end repeat
  234.     setat(ThisHand,player, p)
  235.     set p = empty
  236.   end if
  237.   
  238.   if List = 3 then
  239.     set  txt =  line player of field "BitMap3"
  240.     set w = the number of words in txt
  241.     repeat with c = 2 to w
  242.       put  word c of txt & " " into word C-1 of p 
  243.     end repeat
  244.     setat(ThisHand,player, p)
  245.     set p = empty
  246.   end if
  247.   
  248. end
  249.  
  250. --- while in VideoMarker reset cards to default  after viewing video for detail card
  251. on mResetCard  me, player
  252.   set  txt =  line player of field "BitMapTXT"
  253.   set w = the number of words in txt
  254.   repeat with c = 2 to w
  255.     put  word c of txt & " " into word C-1 of p 
  256.   end repeat
  257.   setat(ThisHand,player, p)
  258.   set p = empty
  259. end
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. --   for KTG toggle of hid all showall prompt
  267.  
  268. on  mAllprompt me, status
  269.   if status  <1 then setat (ScrnHelp,25,"Hide All") 
  270.   if status = 1 then setat (ScrnHelp,25,"Show All")
  271.   updatestage
  272. end
  273.  
  274.  
  275.  
  276.  
  277. -- reset the functions in home for calls to dilbert
  278.  
  279. on MsetDilbert me
  280.   set p = Empty
  281.   repeat with x = 23 to 48
  282.     set  txt =  line x of field "Dilbert"
  283.     put  word 2 of txt into p
  284.     setAt (Menufunctions, x, p)
  285.   end repeat
  286.   set p = Empty
  287. end
  288.  
  289. -- resets the home menu back after returning from the dilbert screen
  290.  
  291. on MsetHomeMenu me 
  292.   set p = Empty
  293.   repeat with x = 23 to 48
  294.     set  txt =  line x of field "RedFlag"
  295.     put  word 2 of txt into p
  296.     setAt (Menufunctions, x, p)
  297.   end repeat
  298.   set p = Empty
  299. end
  300.  
  301. -- changes specific scripts associated with sprite changes
  302.  
  303. on mSetCommand me,Which, Action
  304.   set C = getAt(MenuFunctions, which)
  305.   put Action into C
  306.   setat MenuFunctions,which, c
  307. end
  308.  
  309. -- get help prompt
  310.  
  311. on mFunction me, Which
  312.   return getat(ScrnHelp,which)
  313. end
  314.  
  315. -- get command to be performed
  316.  
  317. on Mdo me, which
  318.   return getAt(MenuFunctions, which)
  319. end
  320.  
  321. -- for SSQ movies find a card or cards to display
  322.  
  323. on mCards me, Which
  324.   if which > EMPTY then
  325.     return getAt(ThisHand, which)
  326.   end if
  327. end
  328.  
  329. -- turns button function on for multiple cards
  330.  
  331. on mMultiOn me
  332.   setat MenuFunctions,11, "CardButton" 
  333. end
  334.  
  335. -- turns button function on for multiple cards
  336.  
  337. on mMultiOff me
  338.   setat MenuFunctions,11, EMPTY 
  339. end
  340.  
  341. -- finds and plays video segments in SSQ movies 
  342.  
  343.  
  344.  
  345. on mVideoSegment me,Which,Multi
  346.   global gClipIn,gClipout,gBt,crdflag1
  347.   
  348.   if the framelabel = "1Video" then set multi = (crdflag1)
  349.   if Which > 0 then
  350.     set temp = getat(VideoCues, which  )
  351.     set vT = word 1 of  temp
  352.     set gClipOut =( the duration of cast  vT)-24
  353.     set gClipIn = 0
  354.     return vT
  355.     set gClipIn = 0
  356.     if gBT <1 then 
  357.       exit 
  358.     end if
  359.   end if
  360. end
  361.  
  362. --- special loadvideo for details on video screen
  363.  
  364. on mDetailvideo me,theOne
  365.   global gClipOut, gPos, gplayerFlag
  366.   puppetsprite 3 ,true
  367.   set the type of sprite 3 = 16
  368.   if theOne > 0 then
  369.     set the castnum of sprite 3 =the number of cast ( theOne)
  370.     set the loch of sprite 3 = 155
  371.     set the locv of sprite 3 = 150
  372.     updatestage
  373.     set gClipOut = the duration of cast theOne-24
  374.     set the movierate of sprite 3 = 1
  375.   end if
  376. end
  377.  
  378.  
  379.  
  380. on mSoundPlayBack me, Which, Snd,LstNum
  381.   if LstNum = 1 then set x =getat(Sound1,which)
  382.   if LstNum = 2 then set x =getat(Sound2,which)
  383.   if LstNum = 3 then set x =getat(Sound3,which)
  384.   put word value(Snd) of x  & " SoundFile" -- remove later
  385.   if  X > EMPTY then puppetSound (word Snd of x)
  386.   updatestage
  387. end
  388.  
  389. on mGetBeyondSound me, which
  390.   set x =  getat(Sound1,which)
  391.   if x > EMPTY then return x
  392. end
  393.  
  394.  
  395. -- Gets flags for SSQ detail cards
  396.  
  397. on mGetCardStatus which
  398.   set  Stat = getat(CardStatus,which)
  399.   return Stat
  400. end
  401.  
  402. -- sets detail card flags
  403.  
  404. on mSetCardStatus which,Status
  405.   Setat(CardStatus,which,Status)
  406. end
  407.  
  408.  
  409. ---------- added function to allow the control of details from the video screen -----------
  410.  
  411. ---- i had to do it this way  because the orginal script used the same list for details cards on 
  412. --- screen 1 and text details on screen two 
  413. --- I did not want to have to rewrite all control scripts so I opted to create a new list to keep track of
  414. -- which players a card details
  415.  
  416. --- remembers which players have detail cards called from setinits in each SSq movie after setcards
  417.  
  418. on MPlayerDetails me
  419.   repeat with x =  1 to 48
  420.     set cards = getAt(ThisHand, x)
  421.     set num = the number of words in cards
  422.     setat(VideoDetails,x,num)
  423.   end repeat
  424. end
  425.  
  426. --- get the number of details for a player -- for video screen
  427.  
  428. on MgetPlayerDetails me, which
  429.   set num =getat(VideoDetails,which)
  430.   return num  
  431. end
  432. --- gets the list of videos for the current player
  433.  
  434. on MgetPossibleVideos me, which
  435.   set temp = getat(VideoCues,which)
  436.   set max = the number of words in temp
  437.   set videos = [  ]
  438.   repeat with x = 1 to max
  439.     append(videos, word x of temp)
  440.   end repeat
  441.   return videos
  442. end
  443.